//
//  ClassTypeTableViewCell.m
//  CoachsBook
//
//  Created by huiyong li on 2022/8/18.
//

#import "ClassTypeTableViewCell.h"


@interface ClassTypeTableViewCell()

@property(nonatomic,strong) UIView *bjview;
@property(nonatomic,strong) UILabel *typeAndPriceLabel;
@property(nonatomic,strong) UILabel *introduceLabel;
@property(nonatomic,strong) UILabel *timeLabel;


@end

@implementation ClassTypeTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier

{
    if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier])
    {
        [self setupUI];
        self.contentView.backgroundColor = rgba(255, 255, 255, 1);
    }
    return self;
}

- (void)setupUI
{
    self.bjview = [[UIView alloc]initWithFrame:CGRectMake(16, 0, APPwidth-32, 110)];
    self.bjview.backgroundColor = rgba(245, 245, 250, 1);
    self.bjview.layer.cornerRadius = 8;
    self.bjview.layer.masksToBounds = YES;
    [self.contentView addSubview:self.bjview];
    
    
    
    self.typeAndPriceLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 10, APPwidth-62, 26)];
    self.typeAndPriceLabel.font = kPingFangSemibold(16);
    self.typeAndPriceLabel.textColor = rgba(51, 51, 51, 1);
    self.typeAndPriceLabel.text = @"C1  周末班 ￥4500";
    [self.bjview addSubview:self.typeAndPriceLabel];
    
    
    
    NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"C1  周末班 ￥4500"]];
    [str addAttribute:NSForegroundColorAttributeName value:rgba(22, 120, 255, 1) range:NSMakeRange(8,5)];
    self.typeAndPriceLabel.attributedText = str;
    
    
    self.introduceLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, CGRectGetMaxY(self.typeAndPriceLabel.frame)+6, APPwidth-62-65, 26)];
    self.introduceLabel.font = kPingFangRegular(14);
    self.introduceLabel.textColor = rgba(51, 51, 51, 1);
    self.introduceLabel.text = @"教练接送  周六到周日训练 两人一车";
    [self.bjview addSubview:self.introduceLabel];
    
    
    self.timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, CGRectGetMaxY(self.introduceLabel.frame)+6, APPwidth-62, 26)];
    self.timeLabel.font = kPingFangRegular(14);
    self.timeLabel.textColor = rgba(51, 51, 51, 1);
    self.timeLabel.text = @"拿本时间:180天以内";
    [self.bjview addSubview:self.timeLabel];
    
    
    self.deleteBut = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth-32-35, CGRectGetMaxY(self.typeAndPriceLabel.frame)+6, 26, 26)];
    [self.deleteBut setImage:[UIImage imageNamed:@"mine_delete"] forState:UIControlStateNormal];
    [self.bjview addSubview:self.deleteBut];
    
    
    self.editorBut = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth-32-70, CGRectGetMaxY(self.typeAndPriceLabel.frame)+6, 26, 26)];
    [self.editorBut setImage:[UIImage imageNamed:@"mine_delete"] forState:UIControlStateNormal];
    [self.bjview addSubview:self.editorBut];
    
    
    self.chooseBut = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth-32-50, CGRectGetMaxY(self.typeAndPriceLabel.frame)+6, 26, 26)];
    [self.chooseBut setImage:[UIImage imageNamed:@"mine_unselected"] forState:UIControlStateNormal];
    [self.chooseBut setImage:[UIImage imageNamed:@"mine_selected"] forState:UIControlStateSelected];
    [self.bjview addSubview:self.chooseBut];
    self.deleteBut.hidden = YES;
    self.editorBut.hidden = YES;
//    self.chooseBut.hidden = YES;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
